import { Module } from '@nestjs/common'
import { ConfigModule } from '@nestjs/config'
import { AuthModule } from './auth/auth.module'
import { PrismaModule } from './prisma/prisma.module'
import { ArticleModule } from './article/article.module'
import { CategoryModule } from './category/category.module'
import { UploadModule } from './upload/upload.module'

/**
 * 记住不要把upload的service和controller注入，否则上传图片放回有buffer，拿不到filename
 */
@Module({
  imports: [
    AuthModule,
    PrismaModule,
    ConfigModule.forRoot({
      isGlobal: true, //把ConfigModule定义为全局可以读取配置项.env
    }),
    ArticleModule,
    CategoryModule,
    UploadModule,
  ],
})
export class AppModule {}
